<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <p class="text">你好吗？</p>
  <script>
    var oP = document.querySelector(".text");
    // 设置DOM元素的内容
    // oP.innerHTML = "你好，DOM";
    // oP.innerHTML = "<a href='http://baidu.com/'>百度</a>";

    // 返回DOM元素的内容
    // var txt = oP.innerHTML;
    console.log(txt);
  </script>
</body>
</html>